- CSS stands for Cascading Style Sheet.
- Styles define how to display HTML elements
- Styles were added to HTML 4.0 to solve a problem
- External Style Sheets can save a lot of work
- External Style Sheets are stored in CSS files
Discover gists
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// resource route component | |
import React from "react"; | |
import { PassThrough } from "node:stream" | |
import fs from "node:fs" | |
import {createReadableStreamFromReadable} from "@remix-run/node" | |
import { defaultQuality,widths,mainImageReadStream,generatedImageReadstream, isThereImage,BadImageResponse } from "../../util/image.server" | |
export const loader = async ({ request }) => { | |
const url = new URL(request.url); | |
const src = url.searchParams.get("src"); |
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
- Follow standard conventions.
- Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
- Boy scout rule. Leave the campground cleaner than you found it.
- Always find root cause. Always look for the root cause of a problem.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
apt update -y && apt upgrade -y | |
apt install -y git automake make gobjc++ libtool pkg-config libmspack-dev libglib2.0-dev libpam0g-dev libssl-dev libxml2-dev libxmlsec1-dev libx11-dev libxext-dev libxinerama-dev libxi-dev libxrender-dev libxrandr-dev libxtst-dev libgdk-pixbuf2.0-dev libgtk-3-dev libgtkmm-3.0-dev | |
git clone https://github.com/vmware/open-vm-tools.git | |
cd open-vm-tools/open-vm-tools/ | |
autoreconf -i | |
./configure --disable-dependency-tracking | |
make | |
make install | |
ldconfig |
This tutorial provides a step-by-step guide to recover the BIOS password from an Asus VivoBook using a memory dump.
- Memory Dump: Obtain the memory dump of the BIOS using either a software method (as shown in the following writeup or a hardware programmer.
- Hashcat: Ensure you have Hashcat installed for brute-forcing the password.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.stepstone.test.rule | |
import android.app.Activity | |
import android.content.Intent | |
import androidx.test.core.app.ActivityScenario | |
import org.junit.rules.ExternalResource | |
class LazyActivityScenarioRule<A : Activity> : ExternalResource { | |
constructor(launchActivity: Boolean, startActivityIntentSupplier: () -> Intent) { |
国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。
Dockerized 实践 https://github.com/y0ngb1n/dockerized
Ubuntu 16.04+、Debian 8+、CentOS 7+
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fire() { | |
local BRANCH=emergency-`date +%s`-`git config user.email` | |
git checkout -b $BRANCH | |
git add -A | |
git commit -m 'EMERGENCY!' | |
git push -f origin $BRANCH | |
} | |
# Inspired by https://www.reddit.com/r/ProgrammerHumor/comments/3nc531/in_case_of_fire/cvn1k27/ |
Steps to deploy a Node.js app to DigitalOcean using PM2, NGINX as a reverse proxy and an SSL from LetsEncrypt
Create free AWS Account at https://aws.amazon.com/
I would be creating a t2.medium ubuntu machine for this demo.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Example to refresh tokens using https://github.com/auth0/node-jsonwebtoken | |
* It was requested to be introduced at as part of the jsonwebtoken library, | |
* since we feel it does not add too much value but it will add code to mantain | |
* we won't include it. | |
* | |
* I create this gist just to help those who want to auto-refresh JWTs. | |
*/ | |
const jwt = require('jsonwebtoken'); |
NewerOlder